home *** CD-ROM | disk | FTP | other *** search
- #import <sys/stat.h> /* stat */
- #import <stdio.h> /* fgets */
- #import <sys/param.h> /* MAXPATHLEN */
- #import <string.h>
- #import <stdlib.h> /* exit */
-
- int main(int argc, char *argv[])
- {
- char *buf;
- struct stat sbuf;
-
- if (argc < 2)
- exit(1);
- /*
- * examine the file name comeing in from standard in
- * non writable files
- */
- buf = argv[1];
- if ( (stat(buf,&sbuf)== -1) || ((sbuf.st_mode & S_IWRITE)!= S_IWRITE ))
- {
- exit(1);
- }
-
- exit(0);
- }